home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / March 96 / Setting Context < prev    next >
Encoding:
Internet Message Format  |  1996-12-03  |  2.6 KB  |  [TEXT/ttxt]

  1. Subject:     Setting Context
  2. Sent:        3/10/96 9:50 PM
  3. Received:    3/11/96 8:27 AM
  4. From:        Gary Ashcraft, ashcraft@itsnet.com
  5. Reply-To:    ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8. Henri & team,
  9. I have a part which is based on ODF Draw (d11).  Within my content view,
  10. I've embedded some subframes.
  11.  
  12. I'm trying to understand the correct way to set the context so I can render
  13. within these subframes.  I've tried using FW_CViewContext,
  14. FW_CFacetContext, and FW_CPlatformGraphicContext (individually, of course).
  15. I want to set the context and then render within the frame using a mix of
  16. ODF rendering methods and native calls.  I would expect that after setting
  17. the context, my rendering would be clipped to the subframe and all of my
  18. rendering would also be relative to the subframe (nominally the topLeft
  19. corner).
  20.  
  21. Here's what I experienced using the above-listed contexts within the
  22. subframe's draw methods:
  23.   FW_CViewContext
  24.     Native calls : rendering was relative to window's origin.
  25.     ODF          : rendering was relative to contentview origin.
  26.     Clipping     : clipped to frame, but if content view is scrolled,
  27. overwrites scrollers & rulers.
  28.   FW_CFacetContext
  29.     Native calls : rendering was relative to window's origin.
  30.     ODF          : rendering was relative to contentview origin
  31.     Clipping     : didn't clip.  If scrolled, ODF calls were offset as
  32. expected, but native calls still were relative to window origin.
  33.   FW_CPlatformGraphicContext
  34.     Native calls : rendering was relative to contentview origin
  35.     ODF          : rendering was relative to contentview origin
  36.     Clipping     : clipped to frame, but if content view is scrolled,
  37. overwrites scrollers & rulers.
  38.  
  39. >From my experimentation it looks like   FW_CPlatformGraphicContext is the
  40. only case where ODF rendering and native rendering calls are in
  41. registration with one another.  However, even using
  42. FW_CPlatformGraphicContext, I still have to clip out the rulers and
  43. scrollers myself, and do a transformation to convert my coordinates from
  44. frame coordinates to contentview-relative.
  45.  
  46. Do I need to make another call to correctly set up the transform?  I had
  47. assumed these calls would set up the transform for me; either they don't,
  48. or something's wrong with my subframe.
  49.  
  50. I would appreciate any additional explanation which you feel would help me
  51. better understand the relationship between these three calls, and the
  52. context in which each should be used.  (I've read both chapter 7 in the ODF
  53. Developers Guide and the ODF View System document, provided with d11)
  54.  
  55. Regards,
  56.  
  57. Gary Ashcraft
  58. ashcraft@itsnet.com
  59.  
  60.